# Maintainer: Antonio Rojas <arojas@archlinux.org>

_pyname=comm
pkgname=python-$_pyname
pkgver=0.1.3
pkgrel=2
pkgdesc='Python Comm implementation for the Jupyter kernel protocol'
arch=(any)
url='https://pypi.org/project/comm/'
license=(BSD)
depends=(python-traitlets)
makedepends=(python-build python-installer python-hatchling)
checkdepends=(python-pytest)
source=(https://github.com/ipython/$_pyname/archive/v$pkgver/$_pyname-$pkgver.tar.gz)
sha256sums=('9bdea650a6194bf1628b17c2668bf74bf5295c87a7528a8aa4fe4472904b26f2')

build() {
  cd $_pyname-$pkgver
  python -m build --wheel --no-isolation
}

check() {
  cd $_pyname-$pkgver
  PYTHONPATH="$PWD" \
  pytest -v
}

package() {
  cd $_pyname-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
}
